package cn.edu.scnu.semart.goods.service;

import cn.edu.scnu.semart.model.goods.GoodsAudit;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * 商品审核Service接口
 */
public interface GoodsAuditService extends IService<GoodsAudit> {

    /**
     * 提交商品审核
     * @param goodsId 商品ID
     * @return 是否成功
     */
    boolean submitForAudit(Integer goodsId);

    /**
     * 审核通过
     * @param goodsId 商品ID
     * @param auditorId 审核人ID
     * @param auditorName 审核人姓名
     * @param remark 审核备注
     * @return 是否成功
     */
    boolean approve(Integer goodsId, Integer auditorId, String auditorName, String remark);

    /**
     * 审核拒绝
     * @param goodsId 商品ID
     * @param auditorId 审核人ID
     * @param auditorName 审核人姓名
     * @param rejectReason 拒绝原因
     * @return 是否成功
     */
    boolean reject(Integer goodsId, Integer auditorId, String auditorName, String rejectReason);

    /**
     * 获取待审核商品列表
     * @param page 分页参数
     * @return 待审核商品列表
     */
    IPage<GoodsAudit> getPendingAuditList(Page<GoodsAudit> page);

    /**
     * 获取审核历史
     * @param goodsId 商品ID
     * @param page 分页参数
     * @return 审核历史
     */
    IPage<GoodsAudit> getAuditHistory(Integer goodsId, Page<GoodsAudit> page);

    /**
     * 获取审核统计
     * @return 审核统计信息
     */
    AuditStatistics getAuditStatistics();

    /**
     * 审核统计信息
     */
    class AuditStatistics {
        private Integer pendingCount;
        private Integer approvedCount;
        private Integer rejectedCount;
        private Integer totalCount;

        // getter和setter方法
        public Integer getPendingCount() { return pendingCount; }
        public void setPendingCount(Integer pendingCount) { this.pendingCount = pendingCount; }
        public Integer getApprovedCount() { return approvedCount; }
        public void setApprovedCount(Integer approvedCount) { this.approvedCount = approvedCount; }
        public Integer getRejectedCount() { return rejectedCount; }
        public void setRejectedCount(Integer rejectedCount) { this.rejectedCount = rejectedCount; }
        public Integer getTotalCount() { return totalCount; }
        public void setTotalCount(Integer totalCount) { this.totalCount = totalCount; }
    }
} 